<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>检验检查报告</title>
    <%- include('../_global/baseLibsJKDA') %>
        <link rel="stylesheet" href="/static/css/public.css" />
        <link rel="stylesheet" href="/static/css/jkda/page-main.css" />
        <script src="/static/js/gzd/pageUrl.js"></script>
        <script src="/static/js/gzd/jkda.js"></script>
        <!--<script src="/static/js/jkda/mbParse/mb_01_view.js"></script>-->

        <style type="text/css">
            html,
            body {
                width: 100%;
                height: 100%;
                margin: 0px;
            }

            body {
                transform: perspective(1400px) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
                transform-style: preserve-3d;
                /* background-color: white; */
            }


            .j-3,
            .j-4 {
                display: inline-block;
                width: 2.38095rem;
                height: 2.14286rem;
                vertical-align: bottom;
                margin-right: 0.47619rem;
            }

            .j-3 {
                background: url(/static/images/jkda/jiuzheng-03.png) no-repeat;
                background-size: cover;
            }

            .j-4 {
                background: url(/static/images/jkda/jiuzheng-04.png) no-repeat;
                background-size: cover;
            }

            h3 {
                font-size: 0.95238rem;
                font-weight: normal;
                display: inline-block;
                line-height: 2;
            }



            #ListTabBox li {

                /* position: relative; */
                /* padding: 0.71429rem 0; */
                font-size: 0.95238rem;
                /* margin: 0 0.95238rem; */
                /* border-bottom: 1px solid #eee; */
            }

            #Jcxx li,
            #Jyxx li {
                background-color: #fff;
                margin-top: 10px;
            }



            #ListTab {
                background-color: #fff;
            }

            .step {
                padding-left: 1.2rem;
                margin-top: .5rem;
            }

            .time {
                border-bottom: 1px solid #e5e5e5;
                color: #666;
                padding-bottom: .5rem;
            }

            h6 {
                position: relative;
                color: #666;
                height: 3.2rem;
                line-height: 3.2rem;
                padding-left: 1.2rem;
                font-size: 1rem;
            }

            #ListTabBox ul h6:after {
                position: absolute;
                display: block;
                right: 1.19048rem;
                top: 1.19048rem;
                content: "";
                width: 0.41429rem;
                height: .85714rem;
                background: url(/static/images/arrow-black-left.png) no-repeat;
                background-size: 100% 100%;
            }

            .weight {
                font-size: 1.2rem;
            }
        </style>

</head>

<body>
    <header class="header-box grey fixed">
        <div class="header-content">
            <div class="left-tool">
                <a class="back" href="javascript:void(0);">
                    <i class="iconfont icon-back"></i>
                </a>
            </div>
            <div class="title">检验检查报告</div>
        </div>
    </header>
    <div class="tab-box">
        <span class="gray-line"></span>
        <ul id="ListTab" class="clearfix">
            <li class="active" href="javascript:void(0)" value="jc">
                <a>检查报告</a>
            </li>
            <li href="javascript:void(0)" value="jy">
                <a>检验报告</a>
            </li>
        </ul>
    </div>
    <div id="ListTabBox">
        <ul class="detail">
            <li class="b-box" id="jy" style="border-bottom: 0px;">
                <!-- <i class="detail-icon j-4"></i><h3>检验信息</h3> -->
                <div id="Jyxx"> </div>
            </li>
            <li class="b-box" id="jc" style="border-bottom: 0px;">
                <!-- <i class="detail-icon j-3"></i><h3>检查信息</h3> -->
                <div id="Jcxx"> </div>
            </li>
        </ul>
    </div>
</body>
<script src="/static/js/jkda/forweb.js"></script>
<script type="text/javascript">
</script>

</html>

<script type="text/javascript">
    var page_jyjc = (function ($, page_jyjc) {
        var zxwyh = $.QuickUrlUtils.getRequest("ZXWYH");
        var cfg_def = {
            // indataJybg: indataJybg,
            // indataJcbg: indataJcbg,
            appendToJyxx: appendToJyxx,
            appendToJcxx: appendToJcxx,
            searchConnect: searchConnect,
            initDataJyJcbg: initDataJyJcbg
        }


        page_jyjc.init = function (cfg) {

            var config = $.extend(
                page_jyjc,
                cfg_def,
                cfg
            );
            console.log(config);
            page_jyjc.initDataJyJcbg();
            // page_jyjc.indataJybg();
            // page_jyjc.indataJcbg();
            $("#jy").hide();

            $("#Jcxx").on("click", "li", function () {
                var hosName = $(this).find("h3").text();
                var reportDate = $(this).find(".clinical-time").text();
                var jcbgData = $(this).attr("data");
                StoreCache.setCache("jcbgData", jcbgData);
                $.pageSwitch.goToUrl("jkda", "jcbg", "hosName=" + hosName + "&reportDate=" +
                    reportDate + "&zxwyh=" +
                    zxwyh);
            })
            $("#Jyxx").on("click", "li", function () {
                var hosName = $(this).find("h3").text();
                var reportDate = $(this).find(".clinical-time").text();
                var jybgData = $(this).attr("data");
                StoreCache.setCache("jybgData", jybgData);
                $.pageSwitch.goToUrl("jkda", "jybg", "hosName=" + hosName + "&reportDate=" +
                    reportDate + "&zxwyh=" +
                    zxwyh);
            });
            $("#ListTab li").on("click", page_jyjc.searchConnect);





        }


        // function indataJybg() {
        //     $.QuickRemote.AjaxJson({
        //         funcName: "/api/gzd/jkda/queryJybg",
        //         callback: page_jyjc.appendToJyxx,
        //         params: {
        //             // "zxwyh" : zxwyh,
        //             "zxwyh": "310225193908163614",
        //             "currentPage": "1", //页码
        //             "pageSize": "10", //显示行数
        //             "medicalOrgId": "", //医疗机构代码
        //             "serialNum": "", //就诊流水号
        //             "beginDate": "", //查询开始时间
        //             "endDate": "", //查询结束时间
        //             "surveyingType": "1", //类型： 1门诊 2住院
        //         },
        //         header: true
        //     });
        // }



        function initDataJyJcbg() {
            //查询检验报告
            $.QuickRemote.AjaxJson({
                funcName: "/api/gzd/jkda/queryJyjcbg",
                callback: function (data) {
                    var obj = {
                        arr: [],
                        arr1: []
                    };
                    data.forEach(function (item, index) {

                        if (item.surveyingType == "1") {
                            obj.arr.push(item);

                        } else {
                            obj.arr1.push(item);

                        }

                    });
                    page_jyjc.appendToJyxx(obj);
                    page_jyjc.appendToJcxx(obj);
                },
                params: {
                    "zxwyh": zxwyh,
                    // "zxwyh": "310225193908163614",
                    "currentPage": "1", //页码
                    "pageSize": "10", //显示行数
                    "medicalOrgId": "", //医疗机构代码
                    "serialNum": "", //就诊流水号
                    "beginDate": "", //查询开始时间
                    "endDate": "", //查询结束时间
                    "surveyingType": "1", //类型： 1门诊 2住院
                },
                header: true
            });
        }

        // function indataJcbg() {
        //     //查询检验报告
        //     $.QuickRemote.AjaxJson({
        //         funcName: "/api/gzd/jkda/queryJcbg",
        //         callback: page_jyjc.appendToJcxx,
        //         params: {
        //             "zxwyh": zxwyh,
        //             "currentPage": "1", //页码
        //             "pageSize": "10", //显示行数
        //             "medicalOrgId": "", //医疗机构代码
        //             "serialNum": "", //就诊流水号
        //             "beginDate": "", //查询开始时间
        //             "endDate": "", //查询结束时间
        //             "surveyingType": "1", //类型： 1门诊 2住院
        //         },
        //         header: true
        //     });
        // }



        function appendToJyxx(response) {
            $("#Jyxx").html(template("JybgDetail", response));
        }

        function appendToJcxx(response) {
            $("#Jcxx").html(template("JcbgDetail", response));
        }

        /**选择检验报告或者检查报告*/
        function searchConnect() {
            $(this).siblings("li").removeClass("active");
            $(this).addClass("active");
            var value = $(this).attr("value");
            if (value == "jc") {
                $("#jy").hide();
                $("#jc").show();
            } else {
                $("#jc").hide();
                $("#jy").show();
            }
        }



        return page_jyjc;


    })(jQuery, {});
</script>
<script type="text/html" id="JcbgDetail">
    {{each arr}}
    <li class="doctor-header" data="{{$value}}">
        <h3 class="step weight">{{$value.hosName}}</h3>
        <p class="step time">
            <span>就诊时间: </span>
            <span class="clinical-time">{{$value.reportDate}}</span>
        </p>
        <h6> 检验: {{$value.reportType}}</h6>
    </li>
    {{/each}}
</script>
<script type="text/html" id="JybgDetail">
    {{each arr1}}
    <li class="doctor-header" data="{{$value}}">
        <h3 class="step weight">{{$value.hosName}}</h3>
        <p class="step time">
            <span>就诊时间: </span>
            <span class="clinical-time">{{$value.reportDate}}</span>
        </p>
        <h6> 检验: {{$value.reportType}}</h6>
    </li>
    {{/each}}
</script>